<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        img {
            max-width: 666px;
            max-height: 666px;
            height: auto;
            zoom:expression( function(e) {
                if(e.width>e.height) {
                    if (e.width>666) {
                        e.height=e.height*(666 /e.width);
                        e.width=666;
                    }
                }
                else {
                    if (e.height>666) {
                        e.width=e.width*(666 /e.height);
                        e.height=666;
                    }
                }
                e.style.zoom='1';
            }
            (this));
            overflow:hidden;
        }
    </style>
</head>

<body>
    <div>
        <img src="CSS3/img/1.png" />
    </div>
</body>

</html>
